import json
class UserInfo:
    def __init__(self,email,name,password,qq):
        self.email=email
        self.name=name
        self.password=password
        self.qq=qq
    def __str__(self):
        return "{"+"email:{},name:{},password:{},qq:{}".format(self.email,self.name,self.password,self.qq)+"}"

str=open("E:/json.txt","r").read()
list=json.loads(str)#得到一个字典
users=[]
for i in list:#遍历字典取值
    user=UserInfo(i['email'],i['name'],i['password'],i['qq'])
    users.append(user)
for user in users:
    print(user)
